﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp15
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue queue = new Queue();
            queue.Enqueue("小张");
            queue.Enqueue("小李");
            queue.Enqueue("小刘");
            Console.WriteLine("购票开始：");

            //这边有一个细节奥 用的for循环

            for (int i = 0; i <= queue.Count + 1; i++)
            {
                Console.WriteLine(queue.Dequeue() + "已购票！");
            }
            Console.WriteLine("购票结束！");

            Console.WriteLine();
            Console.WriteLine();

            //这边就是那个foreach遍历了下

            Queue queue02 = new Queue();
            queue02.Enqueue("混泥土车01");
            queue02.Enqueue("混泥土车02");
            queue02.Enqueue("混凝土车03");
            queue02.Enqueue("混凝土车04");
            object[] vs = queue02.ToArray();

            foreach (var a in vs)
            {
                Console.WriteLine(a);
            }


        }
    }
}
